package com.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * (Building)表实体类
 *
 * @author makejava
 * @since 2021-10-04 16:47:34
 */
@SuppressWarnings("serial")
public class Building extends Model<Building> {
    //id
    @TableId(value = "id", type = IdType.INPUT) //这种方式是主键手动输入
    private Integer id;
    //所属区域
    private String region;
    //栋数编号
    private String dongNo;
    //总栋数
    private Integer sum;
    //描述
    private String remark;
    //创建时间
    private Date createDate;

    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date overDate;

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getOverDate() {
        return overDate;
    }

    public void setOverDate(Date overDate) {
        this.overDate = overDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getDongNo() {
        return dongNo;
    }

    public void setDongNo(String dongNo) {
        this.dongNo = dongNo;
    }

    public Integer getSum() {
        return sum;
    }

    public void setSum(Integer sum) {
        this.sum = sum;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Building{" +
                "id=" + id +
                ", region='" + region + '\'' +
                ", dongNo='" + dongNo + '\'' +
                ", sum=" + sum +
                ", remark='" + remark + '\'' +
                ", createDate=" + createDate +
                ", beginDate=" + beginDate +
                ", overDate=" + overDate +
                '}';
    }
}

